---
title: Alert Dialog
description: A modal dialog that interrupts the user with important content and expects a response.
shadcnDocsLink: https://ui.shadcn.com/docs/components/alert-dialog
---

<ComponentPreview component="alert-dialog">
  ```tsx file=<rootDir>/src/examples/ui/alert-dialog.tsx
  ```
</ComponentPreview>

## Installation

<Installation component="alert-dialog">
  ```tsx file=<rootDir>/src/components/ui/alert-dialog.tsx
  ```
</Installation>

## Usage

```ts
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from '@/components/ui/alert-dialog'
import { Button } from '@/components/ui/button'
```

```tsx
<AlertDialog>
  <AlertDialogTrigger asChild>
    <Button>Open</Button>
  </AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
      <AlertDialogDescription>
        This action cannot be undone. This will permanently delete your
        account and remove your data from our servers.
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Continue</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>
```